<?php

/*
|--------------------------------------------------------------------------
| Application Routes
|--------------------------------------------------------------------------
|
| Here is where you can register all of the routes for an application.
| It's a breeze. Simply tell Laravel the URIs it should respond to
| and give it the controller to call when that URI is requested.
|
*/

// Route::get('/', function () {
//     // return view('welcome');
// });

// //基本路由
Route::get("/hello",function(){
    return "hello world!";
});

// //基本路由
// Route::get("/hello1",function(){
//     return url("aa");  //生成地址
// });


// //带参数的路由
// Route::get("/hello/{id}",function($id){
//     return "参数路由ID".$id;
// });

// //可选参数路由
// Route::get("/demo/{id?}",function($id=0){
//     return "可选参数路由ID".$id;
// });


// //通过URL 访问控制和方法
// Route::get("/photo","photoController@index");
// Route::get("/photo/test","photoController@test");
// Route::get("/photo/getlist","photoController@getList");

// Route::get("/new/delete/{id}","NewController@delete");
// Route::post("/new/update","NewController@update");
// //资源路由
// Route::resource('new', 'NewController');
// // Route::post("doupload","UserController@doUpload");

// //fbsql_username(link_identifier)
// //登陆

Route::get("/Admin","Admin\IndexController@index");
// Route::get("/admin","UserController");
Route::get("/admin/login","Admin\LoginController@login");
Route::post("/admin/dologin","Admin\LoginController@dologin");


// //资源路由 user 暂时使用admin代替
// Route::resource('/admin','UserController');
// //通过url 访问控制和方法
// Route::get("/user/delete/{id}","UserController@delete");


// //个人博客
// Route::get('/art/dis', function () {
//     return Art::paginate();
// });
// Route::get('/art/dis', 'ArticleController@dis');
Route::get("/art/delete","ArticleController@delete");
Route::resource('/art','ArticleController');



//隐士控制器
Route::controller('t5','ArticleController');
//登陆成功之后跳转路由
// Route::resource('/art','ArticleController');
//登录注册路由
// 认证路由...
Route::get('auth/login', 'Auth\AuthController@getLogin');
Route::post('auth/login', 'Auth\AuthController@postLogin');
Route::get('auth/logout', 'Auth\AuthController@getLogout');


// 注册路由...
Route::get('auth/register', 'Auth\AuthController@getRegister');
Route::post('auth/register', 'Auth\AuthController@postRegister');


//后台路由文件
require_once  app_path('Http/Route').'/admin.php';

//home首页
Route::get('/', 'Home\IndexController@index');

//商品列表页
Route::resource('cat','Home\CatController');

//图片上传
Route::resource('image','Home\ImageController');

//商品路由
Route::resource('goods','Home\GoodsController');

//购物车
Route::resource('cart','Home\CartController');
//添加商品到购物车
Route::get('addCart/{gid}/{num?}','Home\CartController@addCart');
//清空购物车
Route::get('delcart','Home\CartController@delCart');
//移除购物车中产品
Route::get('removeItem/{rowId}','Home\CartController@removeItem');
